Skip to content

test(spdx): extend SPDX-header scan to tests/ to match documented intent#263

Merged
CryptoJones merged 1 commit into
masterfrom
test/spdx-headers-also-scan-tests
May 19, 2026
Merged

test(spdx): extend SPDX-header scan to tests/ to match documented intent#263
CryptoJones merged 1 commit into
masterfrom
test/spdx-headers-also-scan-tests

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Summary

The header comment on tests/unit/spdx-headers.test.js claims "every JS file in app/, server.js, and tests/ carries the Apache-2.0 SPDX header" — but SCAN_ROOTS only included 'app'. tests/ was named in the comment but never actually walked. The regression net had a real gap: a future test file copy-pasted from a header-less template would slip past CI.

What changed

  • Added 'tests' to SCAN_ROOTS.
  • Rewrote the surrounding comment to describe the actual scope (the old comment talked about "tests/integration/ skipped" which was confusing given no tests dir was scanned at all).

Impact

  • All current test files already have the header — no false positives.
  • Test count jumps from 688 → 742 (+54 new per-file checks, all passing).
  • Going forward, a missing SPDX header in any tests/**/*.js file will fail CI alongside the same check for app/.

Test plan

  • npm run lint && npm test — 742 passing locally (was 688)

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

… intent

The header comment on this test claims "every JS file in app/, server.js,
and tests/ carries the Apache-2.0 SPDX header" but `SCAN_ROOTS` only
included `'app'` — tests/ was named in the comment but never actually
walked. The regression net had a gap: a future test file copy-pasted
from a header-less template would slip past CI.

All current test files already have the header, so adding `'tests'`
to `SCAN_ROOTS` is a no-op behavior-wise — the new assertions all
pass (test count went from 688 to 742, +54 new per-file checks for
the existing test files). Now the floor matches what the comment
promised.

Updated the surrounding comment to describe the new scope (instead
of the stale "tests/integration/ skipped" note that was confusing
given the actual SCAN_ROOTS didn't include any tests dir at all).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit b0b0980 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the test/spdx-headers-also-scan-tests branch May 19, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant